package com.company.gxcpc2018;

import java.util.Scanner;
import java.util.stream.IntStream;

public class Gxcpc6 {

    private static int[] bian;
    private static boolean[] flag;
    private static int[] tmp;
    private static double max;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            bian = IntStream.generate(sc::nextInt).limit(4).toArray();
            flag = new boolean[4];
            tmp = new int[4];
            max = 0;
            dp(0);
            if (max == 0) {
                System.out.println("IMPOSSIBLE");
            } else {
                System.out.printf("%.2f\n", max);
            }
        }
    }

    private static int tindex = 0;

    public static void dp(int index) {
        if (index == tmp.length) {
            int butSub = tmp[1] - tmp[0];
            int backSum = tmp[2] + tmp[3];
            int backSub = Math.abs(tmp[2] - tmp[3]);

            if (backSub < butSub && backSum > butSub) {
                double s = ts(tmp[0], tmp[1], tmp[2], tmp[3]);
                max = Double.max(max, s);
            }
            return;
        }


        for (int i = 0; i < tmp.length; i++) {
            if (flag[i]) {
                continue;
            }
            flag[i] = true;
            tmp[tindex++] = bian[i];
            dp(index + 1);
            flag[i] = false;
            tindex--;
        }
    }

    public static double ts(int a, int b, int c, int d) {
        int butSub = b - a;
        double p = (butSub + c + d) / 2.0;
        double sanS = Math.sqrt(p * ((p - c) * (p - d) * (p - butSub)));
        double h = sanS * 2 / butSub;
        return (a + b) * h / 2;
    }
}
